<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>会议报名</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link th:href="@{/res/notice/lib/weui.min.css}" rel="stylesheet"/>
    <link th:href="@{/res/notice/css/jquery-weui.css}" rel="stylesheet"/>
    <link th:href="@{/res/notice/css/font-awesome.css?v=4.4.0}" rel="stylesheet"/>
    <link th:href="@{/res/notice/css/common.css}" rel="stylesheet"/>
</head>
<body>
<div class='popup-bottom'>
    <form class="form-horizontal m" id="form-signUp-add">
        <div class="weui-popup__overlay">
            <input name="addresseeId" th:field="${addressee.addresseeId}" type="hidden">
            <input name="noticeId" th:field="${addressee.noticeId}" type="hidden">
            <input name="addresseeName" th:field="${addressee.addresseeName}" type="hidden">
            <input name="addresseeRead" th:field="${addressee.addresseeRead}" type="hidden">
            <input name="readTime" th:field="${addressee.readTime}" type="hidden">
        </div>
        <div class="weui-popup__modal">
            <div class="toolbar">
                <div class="toolbar-inner">
                    <a href="javascript:;" class="picker-button close-popup">关闭</a>
                    <h1 class="title">会议报名</h1>
                </div>
            </div>
            <div class="modal-content bgwhite">
            <textarea name="participantsName" placeholder="请输入姓名（格式：XXX,XXX,XXX 英文逗号分隔）"
                      th:field="*{addressee.participantsName}"
                      class="weui-textarea w90 mauto plr15 ptb10" cols="30" rows="10"></textarea>
                <div class="plr15 ptb10"><a href="javascript:;" class="weui-btn weui-btn_primary close-popup"
                                            onclick="returnSign()">确定</a></div>
            </div>
        </div>
    </form>
</div>
<script th:src="@{/res/notice/lib/jquery-2.1.4.js}"></script>
<script th:src="@{/res/notice/js/jquery-weui.js}"></script>
<script th:src="@{/res/ajax/libs/layer/layer.min.js}"></script>
<script th:inline="javascript">
    var token = [[${token}]];
    var prefix = "/mobile/notice";
    function returnSign() {
        save(prefix + "/signUp", $('#form-signUp-add').serialize(), function (res) {
            if (res.success) {
                $.modal.close();
            }
        });
    }

    function save(url, data, callback) {
        var config = {
            url: prefix + "/signUp",
            type: "post",
            dataType: "json",
            data: data,
            beforeSend: function (request) {
                request.setRequestHeader("X-Access-Token", token);
            }
        };
        $.ajax(config);
        $.toast("操作完成!");
        setTimeout(function () {
            window.location.reload();//刷新当前页面.
        }, 800)
    }
</script>
</body>
</html>
